import api from '../../utils/api'

const app = getApp()

Component({
    properties: {
        bg: {
            type: Boolean,
            default: false
        },
        color: {
            type: String,
            default: '#a0a0a0'
        }
    },
    lifetimes: {
        attached() {
            if (!app.globalData.comInfoUrl) {
                api.get('/api/variable/all').then(res => {
                    app.globalData.comInfoUrl = res[0].laikangSupportImage
                    // console.log(app.globalData.comInfoUrl)
                }).catch(e => {
                    console.log('----------', e)
                })
            }
        }
    },
    options: {
        addGlobalClass: true
    },
    data: {},
    methods: {
        handleToggle() {
            wx.previewImage({
                current: app.globalData.comInfoUrl,
                urls: [app.globalData.comInfoUrl]
            })
        }
    }
})
